AbstractPanel = Ext.extend(ThienTanFormPanel, {
	autoScroll : true,
	cls : 'thientan-inside-panel-background',
	bodyCssClass: 'thientan-form-panel-body',
	luuBtn : null,
	thoatBtn : null,
	justUseDefaultHotKeys : true,
	
	afterRender : function(){
		this.initHotKey();
		if (this.luuBtn) {
			this.luuBtn.on('click', this.save, this);	
		}
		
		if (this.thoatBtn) {
			this.thoatBtn.on('click', this.quit, this);			
		}
		
		AbstractPanel.superclass.afterRender.call(this);
	},
	
	initHotKey : function() {
		// Map one key by key code
		if (this.justUseDefaultHotKeys) {
			this.keys = new Ext.KeyMap(this.el, this.defaultHotKeys());
		}
	},
	
	defaultHotKeys : function() {
		return [{
		    key: 13, // or Ext.EventObject.ENTER
		    fn: this.defaultActionHandler,
		    scope: this
		}, {
		    key: 'q', // or Ext.EventObject.ENTER
		    ctrl : true,
		    fn: this.quit,
		    scope: this
		}]
	},
	
	defaultActionHandler : function(){
		this.save();
	},
	
	save : function() {
		// Implement at sub-class
	},
	
	quit : function() {
		this.destroy();
		ApplicationManager.openMenu(MenuItemId.taoHD);
	},
	
	isSubmittable : function() {
		var isValid = true;
		this.getForm().items.each(function(f){
            if(f.getActiveError()){
            	isValid = false
            }
        });
		return isValid;
	}
	
});